<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>图书列表</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
</head>

<body>

    <div class="container">

        <h1 class="mt-5">图书列表</h1>

        <!-- 导航栏 -->
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
            <div class="container-fluid">
                <a class="navbar-brand" href="#">首页</a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
                    aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav">
                        <li class="nav-item">
                            <a class="nav-link" href="/books">图书列表</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/readers">读者列表</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/lending-records">借阅记录</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>

        <!-- 图书列表表格 -->
        <table class="table table-striped mt-5">
            <thead>
                <tr>
                    <th>图书ID</th>
                    <th>图书名称</th>
                    <th>作者</th>
                    <th>出版社</th>
                    <th>出版年份</th>
                    <th>库存</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="book : ${books}">
                    <td th:text="${book.bookId}"></td>
                    <td th:text="${book.bookName}"></td>
                    <td th:text="${book.author}"></td>
                    <td th:text="${book.publisher}"></td>
                    <td th:text="${book.publicationYear}"></td>
                    <td th:text="${book.stock}"></td>
                </tr>
            </tbody>
        </table>

    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html>